//
//  MCRightCollectionCell.swift
//  MCBodyBuildingPro
//
//  Created by Renlvshijie on 2023/5/17.
//

import UIKit
import QMUIKit
import SnapKit

class MCRightCollectionCell: UICollectionViewCell {
    
    var icnImageView:UIImageView!
    var titleInfoLabel:QMUILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        loadWithSubView()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //处理子View
    func loadWithSubView() -> Void {
        
        let subView = UIView.init()
        subView.backgroundColor = UIColor.white
        self.contentView.addSubview(subView)
        subView.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(0)
            make.right.equalTo(self.contentView.snp.right).offset(0)
            make.bottom.equalTo(self.contentView.snp.bottom).offset(0)
            make.top.equalTo(self.contentView.snp.top).offset(0)
        }
        
        let titleLabel = QMUILabel.init()
        titleLabel.font = UIFont(name: "PingFangSC-Semibold", size: 12)
        titleLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        self.contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(0)
            make.bottom.equalTo(self.contentView.snp.bottom).offset(-10)
        }
        
        titleInfoLabel = titleLabel
        
        let iconImageView = UIImageView.init()
        iconImageView.backgroundColor = UIColor.qmui_color(withHexString: "#E6E6E6")
        iconImageView.image = UIImage(named: "common_blue_image")
        iconImageView.layer.borderColor = UIColor.qmui_color(withHexString: "#E6E6E6")?.cgColor
        iconImageView.layer.cornerRadius = 5
        iconImageView.layer.masksToBounds = true
        iconImageView.layer.borderWidth = 0.5
        self.contentView.addSubview(iconImageView)
        iconImageView.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(0)
            make.right.equalTo(self.contentView.snp.right).offset(0)
            make.bottom.equalTo(titleLabel.snp.top).offset(-6)
            make.top.equalTo(self.contentView.snp.top).offset(0)
        }
        icnImageView = iconImageView
    }
    
}
